#define  _CRT_SECURE_NO_WARNINGS 1
int* productExceptSelf(int* nums, int numsSize, int* returnSize)
{
	int* ret = (int*)malloc(numsSize * sizeof(int));
	*returnSize = numsSize;
	int left = 1, right = 1;
	for (int i = 0; i < numsSize; i++)
	{
		ret[i] = left;
		left *= nums[i];
	}
	for (int i = numsSize - 1; i >= 0 ; i--)
	{
		ret[i] *= right;
		right *= nums[i];
	}
	return ret;
}
int main()
{
	int b[] = { 1,2,3,4 };
	int x;
	int *p = &x;
	productExceptSelf(b, 4, p);


	return 0;
}